//
//  HeartModel.h
//  project
//
//  Created by 黄建华 on 2018/2/6.
//  Copyright © 2018年 黄建华. All rights reserved.
//

#import <Foundation/Foundation.h>
// 每次心率模型
@interface heartSubModel : NSObject
@property (nonatomic, assign) NSInteger count;        // 用分钟表示
@property (nonatomic, assign) NSInteger countMins;    // 分钟
@property (nonatomic, assign) NSInteger heartValue;   // 心率值
@property (nonatomic, strong) NSString  *updateTime; // 按count计算15分钟的间隔对应时间
@end

@interface HeartModel : NSObject
@property (nonatomic, strong) NSString *user_id;
@property (nonatomic, strong) NSString *mac;
@property (nonatomic, strong) NSString *dateString;
@property (nonatomic, assign) BOOL     isSaveAllDay;   // 是否保存了全天

@property (nonatomic, assign) NSInteger dayOfWeek;
@property (nonatomic, assign) NSInteger dayOfMonth;
@property (nonatomic, assign) NSInteger weekCount;     // 当前星期
@property (nonatomic, assign) NSInteger monthCount;    // 当前月份
@property (nonatomic, assign) NSInteger yearCount;     // 当前年份

//心率
@property (nonatomic, assign) NSInteger      heartAve;           // 平均心率
@property (nonatomic, assign) NSInteger      heartMax;           // 最高心率
@property (nonatomic, assign) NSInteger      heartMin;           // 最小心率
@property (nonatomic, strong) NSMutableArray *heartsuArrayAuto;  // 每天心率自动数组
@property (nonatomic, strong) NSMutableArray *heartSuArrayCheck; // 每天心率手动数组
@property (nonatomic, strong) NSArray        *heartChartArray;
@property (nonatomic, strong) NSArray        *heartAllTimeArray;
@property (nonatomic, strong) NSArray        *heartAllValueArray;

@property (nonatomic, strong) NSString *detailData;    // 详细数据

+ (HeartModel *)initWithDate:(NSDate *)date;
+ (HeartModel *)getHeartModelFromDB;
+ (HeartModel *)getHeartModelFromDBWith:(NSDate *)date;
+ (HeartModel *)getHeartModelFromDBWithDayString:(NSString *)string;
- (void)        updateToDBSafely;

// 心率大数据
+ (void)updateHeartData:(NSData *)heartData;
+ (void)heartTransEnd;
- (void)updateRealHeartData:(NSInteger)data;
- (void)updateRealHeartDataEnd:(NSArray *)heartArray;
// 手动同步完之后 心率
+ (void)updateCheckHeart;
//同步下载数据需要的
- (void)saveToDBByDownload;
@end

